package cn.fl.fgi.service.impl;

import cn.cmm.base.framework.exception.BaseException;
import cn.fl.commons.result.ResponseData;
import cn.fl.fgi.api.IFgiBusStatusApiService;
import cn.fl.fgi.api.condition.FgiBusStatusQueryCondition;
import cn.fl.fgi.api.dto.FgiBusStatusWebDTO;
import cn.fl.fgi.service.IFgiBusStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description 业务状态
 * @date: 19:56 2020/4/10
 * @version V1.0
 */
@Service
public class FgiBusStatusServiceImpl implements IFgiBusStatusService {

    @Autowired
    private IFgiBusStatusApiService fgiBusStatusApiService;

    @Override
    public List<FgiBusStatusWebDTO> selectFgiBusStatusList(String busSourceId, String busSource, String busSourceType) throws BaseException {
        FgiBusStatusQueryCondition busStatusCondition = new FgiBusStatusQueryCondition();
        busStatusCondition.setBusSourceId(busSourceId);
        busStatusCondition.setBusSource(busSource);
        busStatusCondition.setBusSourceType(busSourceType);
        ResponseData responseData = this.fgiBusStatusApiService.selectListByBusSource(busStatusCondition);
        if (responseData.isSuccess()) {
            return (List<FgiBusStatusWebDTO>) responseData.getData();
        }
        return null;
    }
}
